Fork me on GitHub

SpringBoot 错误总结

注意:所有文章除特别说明外,转载请注明出处.

1.错误:java.lang.UnsatisfiedLinkError: F:\Software\Apache-Tomcat\apache-tomcat-7.0.90\bin\tcnative-1.dll: Can’t load AMD 64-bit .dll on a IA 32-bit platform

解决:直接在网上下载一个 tcnative-1.dll 64位的复制到tomcat/bin目录下即可,这里是因为两者冲突造成。

2.错误:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.

解决:排除此类的autoconfig。启动以后就可以正常运行。@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})

3.错误:Field userMapper in com.shop.service.impl.UserServiceImpl required a bean of type ‘com.shop.mapper.UserMapper’ that could not be found.

解决:这里是因为注解未找到对一个的mapper,所以报错,去inspections取消对应的提示。

4.新创建SQLSessionFactory
@Resource
private DataSource dataSource;

@Bean
public SqlSessionFactory sqlSessionFactory() throws Exception {
    SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
    sessionFactoryBean.setDataSource(dataSource);
    return sessionFactoryBean.getObject();
}

SLF4J: Class path contains multiple SLF4J bindings.

解决:表示maven棒我们引入了两个日志jar包,删掉其中一个便可。

本文标题:SpringBoot 错误总结

文章作者:Bangjin-Hu

发布时间:2019年10月15日 - 09:22:26

最后更新:2020年03月30日 - 07:59:51

原始链接:http://bangjinhu.github.io/undefined/SpringBoot - 错误总结/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

Bangjin-Hu wechat
欢迎扫码关注微信公众号,订阅我的微信公众号.
坚持原创技术分享,您的支持是我创作的动力.